﻿@model RecurringPaymentModel

@{
    const string hideInfoBlockAttributeName = "RecurringPaymentPage.HideInfoBlock";
    var customer = await workContext.GetCurrentCustomerAsync();
    var hideInfoBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideInfoBlockAttributeName);

    const string hideHistoryBlockAttributeName = "RecurringPaymentPage.HideHistoryBlock";
    var hideHistoryBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideHistoryBlockAttributeName, defaultValue: true);
}

<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />

<section class="content">
    <div class="container-fluid">
        <div class="form-horizontal">
            <nop-cards id="recurringpayment-edit">
                <nop-card asp-name="recurringpayment-info" asp-icon="fas fa-info" asp-title="@T("Admin.RecurringPayments.Info")" asp-hide-block-attribute-name="@hideInfoBlockAttributeName" asp-hide="@hideInfoBlock">@await Html.PartialAsync("_CreateOrUpdate.Info", Model)</nop-card>
                <nop-card asp-name="recurringpayment-history" asp-icon="fas fa-history" asp-title="@T("Admin.RecurringPayments.History")" asp-hide-block-attribute-name="@hideHistoryBlockAttributeName" asp-hide="@hideHistoryBlock">@await Html.PartialAsync("_CreateOrUpdate.History", Model)</nop-card>

                @await Component.InvokeAsync("AdminWidget", new { widgetZone = AdminWidgetZones.ReccuringPaymentDetailBlock, additionalData = Model })
            </nop-cards>
        </div>
    </div>
</section>